from data015.Base import Base
import openpyxl,pytest
from selenium import webdriver
@pytest.fixture
def driver():
    driver = webdriver.Edge()
    driver.maximize_window()
    yield driver
    driver.quit()
def test_jiouxian_01(driver):
    work = openpyxl.load_workbook(r'D:\Pycharm_Django\PyCharm\data_8_14\case003\data015\jiouxian.xlsx')
    wate = work['Sheet1']
    base = Base(driver)
    for row in wate.iter_rows(min_row=2,values_only=True):
        browser = row[2]
        pamser = {}

        if browser == 'get':
            pamser['url'] = row[5]
            print('网址:',row[5])
        elif browser == 'click':
            pamser['loc'] = [row[3],row[4]]
            print('登录定位:', [row[3],row[4]])
        elif browser == 'send_keys':
            pamser['loc'] = [row[3], row[4]]
            pamser['info'] = row[5]
            print('账号/密码定位:', [row[3], row[4]])
            print('账号/密码:', row[5])
        elif browser == 'sleep':
            pamser['sj'] = row[5]
        aa = getattr(base,str(browser))
        if browser == 'text':
            pamser['loc'] = [row[3], row[4]]
            assert 'jxw357734689' == row[5]
            print('断言:',row[5])
        aa(**pamser)


